A QR code is also referred to as a two-dimensional barcode. The QR code records data symbol information by using a pattern that is formed by arranging a specific type of geometric pattern in a plane (two-dimensional direction) based on a specific rule. Compared with a conventional barcode, the QR code is characterized by high information capacity, strong error correction capability, high decoding reliability, etc., and has advantages like low costs, easy to make, etc. Therefore, the QR code has been widely used in multiple fields, such as the payment field and the identity authentication field.
When a QR code is being used, after the QR code is scanned, the QR code needs to be identified to obtain data symbol information stored in the QR code. After a QR code pattern is scanned, a QR code is positioned and decoded, to identify the QR code. In a related technology, position detection patterns in the QR code image are first identified, and then the QR code is positioned by using the position detection patterns.
In routine use of the QR code, a problem of poor recognition performance often occurs in some environments. For example, when position detection patterns of the QR code are slightly stained or are weak in brightness, the position detection patterns of the QR code often cannot be accurately identified. As a result, the QR code cannot be positioned, and consequently the QR code fails to be identified. Therefore, a QR code positioning method with relatively high accuracy and validity in different environments is urgently needed in the industry.